<template>
	<view class="articleBox">
		<view class="titles">
			<view class="tit">{{detail.title}}</view>
			<view class="info">发布时间：{{detail.create_time}}</view>
		</view>
		<view class="conts">
			<rich-text :nodes="detail.content"></rich-text>
		</view>
	</view>
</template>

<script>
	import {mapState} from 'vuex';
	export default {
		data() {
			return {
				detail:'',
				id:''
			}
		},
		computed:{
			...mapState(['hasLogin','userInfo'])
		},
		onLoad(options) {
			if(options.id){
				var that = this
				var id = options.id
				that.id = id
				var _param = {id:id}
				that.$api.getUrl(that.$api._api.ApiAnounceDetail,_param,function(res){
					res.create_time = that.$api.timestampToTime(res.create_time*1000)
					that.detail = res
				})
			}else{
				this.$api.msg('参数错误');
				setTimeout(()=>{
					uni.navigateBack({
						delta:1
					})
				},1500)
			}
		},
		methods: {
			
		}
	}
</script>

<style lang="scss">
	page{background:#fff;}
	.articleBox{
		padding: 30rpx;
		.titles{
			.tit{font-size: 30rpx;font-weight: bold;}
			.info{font-size: 26rpx;color:#999;margin-top:12rpx;margin-bottom:24rpx;}
		}
		.conts{text-indent:2em;}
		.img{margin: 40rpx 0;
			image{width: 100%;}
		}
		.preface{font-size: 26rpx;color:#999;margin-bottom: 40rpx;line-height: 40rpx;}
		.title{font-size:28rpx;font-weight: bold;margin-bottom: 40rpx;}
		.cont{font-size: 28rpx;color:#333;margin-bottom:30rpx;line-height: 40rpx;}
	}
</style>
